
#include "xapp_config.h"

#if SYSTEM_MODE_FACTORY_TEST_ENABLE

#if USER_CHECK_ENABLED( FACTORY_TEST ) == 0
#error "System Factory test enabled, but xapp_factory_test is DISABLE\r\n"
#endif // !USER_CHECK_ENABLED( FACTORY_TEST ) == 0


#include "system_list.h"



#include "xtask+peripheral.h"

#include "xapp_osllv.h"
#include "xapp_touchpanel.h"
#include "xapp_factory_test.h"

#include "em_rtc.h"

#include "log.h"
#define LOG     LOG_INFO0

static void init(void)
{    
    LOG("[SYSTEM]: enter FACTORY-TEST mode"); 
    // nothings to do 
    LOG("[SYSTEM]: FACTORY-TEST mode init done");

//    xapp_touchpanel_start();
    // xapp_view_enable_input();

    xapp_factory_test_start();
    OSLLV_SEND_TAG_EXE( OSLLV_TAG_FACTORY_TEST );
}

static void destroy(void)
{
    LOG("[SYSTEM]: exit FACTORY-TEST mode"); 
}

static void task_loop(uint8_t flag)
{

}

const user_system_desc_t  gsSYSTEM_FACTORY_TEST = 
{
    .mode = SYSTEM_MODE_FACTORY_TEST,
    .function = 
    {
    .init = init,
    .destroy = destroy,
    .task_loop = task_loop
    }
};

#endif // !SYSTEM_MODE_FACTORY_TEST_ENABLE
